﻿<%@ Page UICulture="zh-CN" Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeBehind="AdmParcelTransfer.aspx.cs" Inherits="FastShip88.Admin.AdmParcelTransfer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">


             <asp:Label ID="Label3" runat="server" Text="下面列出待处理的中转请求，包括未付款的：" CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                    
                    <asp:GridView ID="gvPendingReq" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id" Width="780px"    EmptyDataText="没有数据！" CellPadding="1" AllowPaging="True" PageSize="10"  
                    onpageindexchanging="gvPendingReq_PageIndexChanging"   onselectedindexchanged="gvPendingReq_SelectedIndexChanged"  >
                    <Columns>

                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="Id" HeaderText="系统编号" ReadOnly="True" 
                             >
                            <ItemStyle Width="60px" />
                         </asp:BoundField>

                        <asp:BoundField DataField="UserName" HeaderText="用户名称" ReadOnly="True" 
                            SortExpression="UserName" >
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True" 
                            SortExpression="Description">
                        <ItemStyle Width="200px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ReqDate" HeaderText="创建日期" ReadOnly="True"  DataFormatString="{0:d}"  Visible ="false">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="receiptor" HeaderText="收件人" ReadOnly="True" 
                            SortExpression="receiptor" >
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="TransferAddr" HeaderText="收货地址" ReadOnly="True" 
                            Visible="True">
                            <ItemStyle Width="200px" />
                        </asp:BoundField>
                         <asp:CheckBoxField DataField="IsPaid" HeaderText="是否付款" ReadOnly="True">
                            <ItemStyle Width="60px" />
                        </asp:CheckBoxField>
                        <asp:BoundField DataField="UserBillId" HeaderText="付款单号" Visible="False">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        
                     </Columns>
                        <EmptyDataTemplate>
                            &nbsp;
                        </EmptyDataTemplate>
                    <SelectedRowStyle BackColor="#669999"  />
                    <HeaderStyle BackColor="#999999" ForeColor="White" />
                </asp:GridView>

            
            <br />
            <div id ="divParcelsInReq" runat="server" >
            <br /> <asp:Label ID="Label5" runat="server" Text="下面列出该中转请求相关的包裹：" CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:FastShip88ConnectionString %>" 
                                                
                    SelectCommand="SELECT * FROM [ParcelInfos] WHERE ([TransferReqId] = @TransferReqId)" 
                    UpdateCommand="UPDATE [ParcelInfos] SET  [OutParcelNo] = @OutParcelNo WHERE [Id] = @Id">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="gvPendingReq" Name="TransferReqId" 
                                                        PropertyName="SelectedValue" Type="Int32" />
                                                </SelectParameters>
                                                <UpdateParameters>
                                                    <asp:Parameter Name="OutParcelNo" Type="String" />
                                                    <asp:Parameter Name="Id" Type="Int32" />
                                                </UpdateParameters>
                                            </asp:SqlDataSource>
                            <asp:GridView ID="gvParcelsInReq" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id" Width="860px"   EmptyDataText="没有数据！" 
                    CellPadding="1"  DataSourceID="SqlDataSource1" 
                    onrowediting="gvParcelsInReq_RowEditing" 
                    onrowupdated="gvParcelsInReq_RowUpdated" 
                    onrowupdating="gvParcelsInReq_RowUpdating"  >
                    <Columns>

                        <asp:CommandField ShowEditButton="True" />

                        <asp:BoundField DataField="Id" HeaderText="系统编号" ReadOnly="True" >
                         <ItemStyle Width="60px" />
                         </asp:BoundField>

                        <asp:BoundField DataField="ParcelNo" HeaderText="入站运单号" ReadOnly="True" 
                            SortExpression="ParcelNo">
                        <ItemStyle Width="160px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True" 
                            SortExpression="Description">
                        <ItemStyle Width="340px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Weight" HeaderText="重量" ReadOnly="True" 
                            SortExpression="Weight" Visible="True">
                        <ItemStyle Width="60px" />
                        </asp:BoundField>
                        
                        <asp:TemplateField HeaderText="出站运单号">
                            <ItemTemplate> 
                              <asp:Label ID="lblOutParcelNo" Runat="Server" 
                                         Text='<%# Eval("OutParcelNo") %>' />
                            </ItemTemplate>
                             <ItemStyle Width="160px" />
                            <EditItemTemplate>
                              <asp:TextBox ID="txtOutParcelNo" Runat="Server" Text='<%# Bind("OutParcelNo") %>'     />
                            </EditItemTemplate>
                          </asp:TemplateField>   
                     
                        
                     </Columns>
                    <SelectedRowStyle BackColor="#669999"  />
                    <HeaderStyle BackColor="#999999" ForeColor="White" />
                </asp:GridView>
                <br />
                
                  <table style="width: 700px;">
 
                       <tr>
                        <td>
                            &nbsp;系统备注，可不填：
                        </td>
                        <td colspan=2 >
                            &nbsp;<asp:TextBox ID="txtMemo" runat="server" Width="500px" Height="42px"></asp:TextBox>
                        </td>
                        
                    </tr>
               
                     <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td colspan=2>
                            &nbsp;
                        </td>
                        
                    </tr>
                 </table>
                <asp:Button ID="btnTransfer" runat="server" Text="中转完成" 
                    onclick="btnTransfer_Click" />&nbsp; &nbsp;
                
            </div>
                <hr />

   
             <asp:Label ID="lblError" runat="server" Text="出现错误" Font-Bold="True" 
              Font-Size="Medium" ForeColor="#CC0000" Height="30px" Visible="False" 
              Width="500px"></asp:Label>
                
            <asp:Label ID="lblSuccess" runat="server" Text="操作成功" Font-Bold="True" 
              Font-Size="Medium" ForeColor= "Green" Height="30px" Visible="False" 
              Width="500px"></asp:Label>

</asp:Content>
